﻿using GN.Pay.TradeChannel.Configure;
using GN.Pay.TradeChannel.DefaultImpl;
using GN.Pay.Utils.Security;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GN.Pay.TradeChannel.UnionPay
{
    [Serializable]
    public class UnionPayConfigureInfo : ChannelPfxSignConfigureInfo
    {
        private string _SignCertId = null;

        /// <summary>
        /// 获取签名的证书Id
        /// </summary>
        /// <returns></returns>
        public string GetSignCertId()
        {
            if (string.IsNullOrWhiteSpace(_SignCertId)
                && SignPfxRaw() != null && !string.IsNullOrWhiteSpace(SignPfxPassWord))
            {
                _SignCertId = RsaUtils.CertSerialNumber(SignPfxRaw(), SignPfxPassWord);
            }
            return _SignCertId;
        }
    }
}
